/*

 @name    : 锅巴汉化 - Web汉化插件
 @author  : 麦子、JAR、小蓝、好阳光的小锅巴
 @version : V0.6.1 - 2019-07-09
 @website : http://www.g8hh.com

*/

//1.汉化杂项
var cnItems = {
    _OTHER_: [],

    //工具页面：
    '← Game': '← 游戏',
    'FAQ': '常见问题',
    'Changelog': '更新日志',
    'Fix': '修复',
    'Load save': '加载存档',
    'Input': '输入',
    'Output': '输出',
    'Tools': '工具',
    'Back to top': '回到顶部',
    'What is this page?': '这是什么页面？',
    'This page contains some tools and cheats for players who have been affected by bugs and balancing issues in the game. The cheats here are quite specific, so unless you\'ve been directed here to fix a specific issue, they will likely not be useful to you.': '此页面包含一些工具和作弊技巧，供受到游戏错误和平衡问题影响的玩家使用。 这里的作弊是非常具体的，因此，除非您被指示在此处解决特定问题，否则它们可能对您没有用。',
    'PROBLEM: Stuck on level 12 with not enough evidence': '问题:在没有足够线索的情况下卡在第12层',
    'PROBLEM: Stuck on level 13 with not enough evidence': '问题:在没有足够线索的情况下卡在第13层',
    'Paste the save you want to fix to the "Input" box. You can export your save from the game via the import/export popup in the footer. Once a fix has been applied, the fixed save will appear in the "Output" box. You can then import it to the game using the same popup.': '将您想要修复的保存粘贴到“输入”框。你可以通过页脚的导入/导出弹出窗口从游戏中导出保存。一旦应用了修复，修复后的保存将出现在“输出”框中。然后你可以使用相同的弹出框将其导入游戏。',
    'Level 13 Tools': '13层工具',
    'If you unlocked Building Projects before Crafting, you might have gotten stuck without enough evidence for Crafting and no more sectors you can scout due to them being too cold. This tool will remove the Building Projects upgrade and reinburse the amount of Evidence you spent on it, allowing you to get Crafting first and continue.': '如果你在锻造前解锁建筑项目，你可能会因为没有足够的锻造线索而卡住，也没有更多的区域你可以侦查，因为它们太冷了。这个工具将移除建筑项目的升级，并重新补偿你在上面花费的线索，让你能够首先获得锻造并继续。',
    'If you played version 0.3.1 and bought all other available upgrades before Compass, you might have gotten stuck without enough evidence to buy Compass. This tool will remove the Knife upgrade from you and reinburse the amount of Evidence you spent on it, allowing you to continue.': '如果你玩过0.3.1版本并在指南针之前购买了所有其他可用的升级，你可能会因为没有足够的线索而无法购买指南针。这个工具将删除你的刀升级，并重新补偿你在它上花费的线索，让你继续。',
    // FAQ
    ". Keep in mind that there are plenty of features that are already planned but haven't been implemented yet.": ".请记住，有很多功能已经计划好但尚未实施。",
    "(go to \"Issues\" and then click \"New Issue\"). Alternatively you can leave a comment on the latest bug thread on": "（转到“问题”，然后单击“新问题”）。或者，您可以在最新的错误线程上发表评论",
    "and see if you can find some hints or help there.": "看看你是否可以在那里找到一些提示或帮助。",
    "changelog": "变更日志",
    "Currently, artefacts are not used for anything. Some traders will buy them.": "目前，人工制品不用于任何用途。一些交易者会购买它们。",
    "Discord": "不和谐",
    "Discord server": "不和谐服务器",
    "Gameplay": "游戏玩法",
    "General": "一般的",
    "go to \"Issues\" and then click \"New Issue\"). Alternatively you can leave a comment on the latest bug thread on": "转到“问题”，然后单击“新问题”）。或者，您可以在最新的错误线程上发表评论",
    "Head over to": "前往",
    "How do I fix the staircase?": "怎么修楼梯？",
    "How do I get fuel?": "我如何获得燃料？",
    "How do I get more crafting ingredients?": "我如何获得更多的制作材料？",
    "I don't have enough storage space to build anything.": "我没有足够的存储空间来构建任何东西。",
    "I found a bug! What should I do?": "我发现了一个错误！我该怎么办？",
    "I have a suggestion for the game.": "我对游戏有一个建议。",
    "I'm still stuck!": "我还是卡住了！",
    "Is there an ending?": "有结局吗？",
    "Is there anything I can do about raids?": "关于突袭，我能做些什么吗？",
    "Level 13 FAQ": "13 级常见问题解答",
    "or": "或者",
    "or pop by our": "或弹出我们的",
    "Reddit": "Reddit",
    "Research fortifications and build up your defences. When a raid is in progress, you can't interact with it.": "研究防御工事并建立防御。当突袭正在进行时，您无法与之互动。",
    "Silver is a currency used for trade. Trade will become available after unlocking the corresponding upgrade. Not all traders accept silver.": "白银是一种用于贸易的货币。解锁相应升级后即可进行交易。并非所有交易者都接受白银。",
    "Some levels don't have enough human activity or are too polluted to support a camp. There are hints in the log and in the sector description to that effect.": "有些关卡没有足够的人类活动，或者污染太严重，无法支撑营地。日志和扇区描述中对此有提示。",
    "The game will let you know when you've reached the end of the currently available content.": "当您到达当前可用内容的末尾时，游戏会通知您。",
    "The plan is to complete the web version first.": "计划是先完成网页版。",
    "There are spots on the map where specific ingredients are found more often. Enemies also often drop them.": "地图上有些地方更容易找到特定成分。敌人也经常掉落它们。",
    "There is no camp on level 11!": "11层没有营地！",
    "This is a personal side project, so development is quite slow and updates are irregular. You can have a look at the": "这是一个个人项目，所以开发很慢，更新不规律。你可以看看",
    "to see if there's been any recent activity. Be warned that at this stage, updates might break old saves and force you to start over.": "看看最近有没有活动。请注意，在此阶段，更新可能会破坏旧的保存并迫使您重新开始。",
    "to see when the game was last updated or check": "查看游戏上次更新的时间或检查",
    "What are artefacts for?": "文物有什么用？",
    "What is silver used for?": "白银是干什么用的？",
    "When will the game be updated?": "游戏什么时候更新？",
    "Will there be a mobile version?": "会有手机版吗？",
    "You can leave suggestions and feature requests on": "您可以留下建议和功能请求",
    "You can report it to the developer. The main platform for reporting bugs is": "您可以将其报告给开发人员。报告错误的主要平台是",
    "You need to find a workshop and clear it of enemies so your workers can use it.": "您需要找到一个车间并清除它的敌人，以便您的工人可以使用它。",
    "You will be able to expand your storage more later. Explore the map to find out how.": "稍后您将能够更多地扩展您的存储空间。探索地图以了解方法。",
    "You will need to find the correct blueprints by exploring the map. Some passages will only be fixable later in the game.": "您需要通过探索地图找到正确的蓝图。有些段落只能在游戏后期修复。",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    // 更新日志
    "Visual view of the current camp and its buildings": "当前营地及其建筑物的视觉视图",
    "Visualization of the tech tree": "科技树的可视化",
    "Working crafting system and all basic items. Secondary resources (crafting ingredients": "工作制作系统和所有基本项目。二级资源（制作材料",
    "A friendly popup when the game crashes": "游戏崩溃时的友好弹出窗口",
    "Add a new movement blocker: debris": "添加一个新的移动拦截器：碎片",
    "Add active and passive rumour generation to markets": "向市场添加主动和被动谣言生成",
    "Add locations with scavengeable crafting ingredients": "添加具有可清除的制作成分的位置",
    "Add many more enemy types and many new items": "添加更多敌人类型和许多新物品",
    "Add map pieces and graffiti that help navigating new areas": "添加有助于导航新区域的地图片段和涂鸦",
    "Add more enemies and make enemy difficulty more dynamic": "添加更多敌人并使敌人的难度更加动态",
    "Add more items, equipment and crafting materials": "添加更多物品、设备和制作材料",
    "Add possibility to improve (some) buildings for small effect boosts": "增加改善（某些）建筑物以提高效果的可能性",
    "Add tools page with limited cheats to help players affected by bugs": "添加具有有限作弊功能的工具页面，以帮助受错误影响的玩家",
    "Add upgrades to traps and buckets": "为陷阱和水桶添加升级",
    "Adjust balancing (raids, rumours, upgrades, reputation": "调整平衡（突袭、谣言、升级、声望",
    "Adjust balancing for buildings, crafting, upgrades, fights, raids and scavenging results": "调整建筑、制作、升级、战斗、突袭和清理结果的平衡",
    "Adjust level sizes and structure": "调整关卡大小和结构",
    "Adjust upgrade unlocking order (Block Knife from being unlocked on Level": "调整升级解锁顺序（挡刀在关卡解锁",
    "Adjust upgrade unlocking order (ensure unlocking Knife doesn't block Compass": "调整升级解锁顺序（确保解锁刀不会挡住指南针",
    "Adjust upgrade/evidence balancing": "调整升级/证据平衡",
    "Balancing improvements (upgrades, storage capacity, building costs": "平衡改进（升级、存储容量、建筑成本",
    "Basic camp game play": "基本的营地游戏",
    "Basic exploration": "基础探索",
    "Bigger difference between camps on different levels (population density": "不同级别的营地之间差异较大（人口密度",
    "Black skin for dark levels/sectors": "黑暗级别/部门的黑皮肤",
    "Blueprints are made of pieces which must be separately collected": "蓝图由必须单独收集的碎片组成",
    "Bugfixes": "Bug修复",
    "Bugfixes and performance improvements": "错误修复和性能改进",
    "Bugfixes and testing tools": "错误修正和测试工具",
    "Currency, trade partners on the map, outgoing trade caravans and incoming traders": "货币、地图上的贸易伙伴、外出贸易商队和进入贸易商",
    "Deity, favour, temples, shrines, greenhouses, and a new resource (rubber": "神、恩惠、寺庙、神社、温室和新资源（橡胶",
    "Environmental hazards: cold, radiation and poison": "环境危害：寒冷、辐射和毒物",
    "Exploration more risky, but also has more rewards": "探索风险更大，但也有更多回报",
    "Exploration now requires food and water": "探索现在需要食物和水",
    "Fights changed from action to random encounters": "战斗从行动变为随机遭遇",
    "Healing injuries is no longer instant": "治愈伤害不再是即时的",
    "Improve fight UI": "改善战斗界面",
    "Improve followers and add different follower abilities": "提高追随者并添加不同的追随者能力",
    "Improve UI for screen reader users": "为屏幕阅读器用户改进 UI",
    "Improved exploration UI": "改进的探索用户界面",
    "Improved followers and inn functionality": "改进的追随者和旅馆功能",
    "Improved header appearance and show item stats more clearly": "改进了标题外观并更清晰地显示项目统计信息",
    "Improved maps": "改进的地图",
    "Improved performance": "提高性能",
    "Improved sector descriptions": "改进的部门描述",
    "Improved sector generation (more intersections and more interesting level shapes": "改进的扇区生成（更多的交叉点和更有趣的关卡形状",
    "Improved tech tree visualization": "改进的科技树可视化",
    "Improved UI for building projects": "改进了用于构建项目的 UI",
    "Improved world generation (structure, hard levels, validation": "改进的世界生成（结构、难度级别、验证",
    "Improved world generation and better level structure": "改进的世界生成和更好的关卡结构",
    "Initial building list": "初始建筑清单",
    "Initial list of upgrades, upgrades balancing & blueprint mechanic": "升级、升级平衡和蓝图机制的初始列表",
    "Introduce scavenged %, giving diminishing rewards for scavenging the same sector": "引入 scavenged %，为清除同一扇区提供递减的奖励",
    "Level 13 Changelog": "13 层 更新日志",
    "Levels are composed of randomly generated paths and have intersections": "关卡由随机生成的路径组成，并有交叉点",
    "Levels where no camp can be built": "无法建造营地的关卡",
    "Locales: new scouting opportunities that appear on some sectors": "地区：出现在某些领域的新球探机会",
    "Lots of bugfixes, especially for late-game": "大量的错误修正，尤其是对于游戏后期",
    "Lots of new log messages for results of player actions when exploring": "探索时玩家操作结果的大量新日志消息",
    "Lots of small bugfixes": "许多小错误修正",
    "Lots of small UI fixes and additions": "许多小的 UI 修复和添加",
    "Make all fights drop crafting ingredients": "让所有战斗都掉落制作材料",
    "Make building effects clearer (upgrades unlock building levels, no automatic effects": "使建筑效果更清晰（升级解锁建筑等级，没有自动效果",
    "Make some debuffs (hunger, thirst, cold, poison, radiation) less forgiving by adding them slowly instead of immediately": "通过缓慢而不是立即添加一些减益效果（饥饿、口渴、寒冷、毒药、辐射）来降低它们的宽容度",
    "Manually choosing equipped items": "手动选择装备物品",
    "More bag levels": "更多包级别",
    "More challenges and rewards to campless levels (more encounters, blueprints": "更多挑战和奖励到营地级别（更多遭遇，蓝图",
    "More clothing slots & items": "更多服装插槽和物品",
    "More varied resources found when scavenging": "清理时发现更多不同的资源",
    "New building: beacon": "新建筑：灯塔",
    "New building: caravan stable": "新建筑：大篷车马厩",
    "New building: generator (increases reputation": "新建筑：发电机（增加声望",
    "New consumable item that restores stamina": "恢复体力的新消耗品",
    "New equipment for surviving extremely irradiated levels": "用于在极端辐照水平下生存的新设备",
    "New improvement: aqueduct": "新改进：渡槽",
    "New items: first aid kits and glowsticks": "新物品：急救箱和荧光棒",
    "New levels (the ground level and level 14, an extremely radioactive level": "新级别（地面层和 14 层，放射性极强的层）",
    "Notifications for new content in tabs like available buildigs or items": "选项卡中新内容的通知，例如可用的建筑或项目",
    "Option to export/import save. (Breaks old saves": "导出/导入保存的选项。 （打破旧的保存",
    "Polish the Rejuv Shot (block using twice; only restores stamina and doesn't affect max stamina": "抛光回春射击（使用两次格挡；仅恢复耐力，不影响最大耐力",
    "Polished reputation, raids and trade": "完善的声望、突袭和贸易",
    "Proper inventory management and add weights for items": "适当的库存管理并为物品添加重量",
    "Rebalanced upgrades and a few new ones. Several buildings can now be upgraded": "重新平衡升级和一些新的。现在可以升级几座建筑物",
    "Refactor CSS styles and color themes for easier maintanability": "重构 CSS 样式和颜色主题以便于维护",
    "Remove time-based food/water consumption and time-based stamina recovery while exploring": "在探索时移除基于时间的食物/水消耗和基于时间的耐力恢复",
    "Reputation logic changed (camp-dependent and changing over time": "声誉逻辑发生了变化（取决于阵营并随时间而变化",
    "Rework how food and water work while exploring & add springs": "在探索和添加泉水时重新设计食物和水的工作方式",
    "Simple ending to the game": "简单的游戏结局",
    "Small bugfixes": "小错误修正",
    "Smaller saves": "较小的节省",
    "Some items can be left in the camp (and not lost them when fainting": "有些物品可以留在营地（晕倒时不会丢失",
    "Stamina regeneration much slower while exploring and option to recover it in camp": "探索和选择在营地恢复时，耐力恢复速度要慢得多",
    "Timer for next worker": "下一个工人的计时器",
    "Two new buildings that increase reputation: Garden and Square": "两个增加声望的新建筑：花园和广场",
    "UI improvements (collect 1, simplify rest outside, animations for numbers": "UI改进（收集1，简化外面的休息，数字的动画",
    "Unlock more levels": "解锁更多层级",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",

    //原样
    '': '',
    '': '',

}


//需处理的前缀
var cnPrefix = {
    "(-": "(-",
    "(+": "(+",
    "(": "(",
    "-": "-",
    "+": "+",
    " ": " ",
    ": ": "： ",
    "\n": "",
    "                   ": "",
    "                  ": "",
    "                 ": "",
    "                ": "",
    "               ": "",
    "              ": "",
    "             ": "",
    "            ": "",
    "           ": "",
    "          ": "",
    "         ": "",
    "        ": "",
    "       ": "",
    "      ": "",
    "     ": "",
    "    ": "",
    "   ": "",
    "  ": "",
    " ": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
}

//需处理的后缀
var cnPostfix = {
    ":": "：",
    "：": "：",
    ": ": "： ",
    "： ": "： ",
    " ": "",
    "/s)": "/s)",
    "/s": "/s",
    ")": ")",
    "%": "%",
    "                   ": "",
    "                  ": "",
    "                 ": "",
    "                ": "",
    "               ": "",
    "              ": "",
    "             ": "",
    "            ": "",
    "           ": "",
    "          ": "",
    "         ": "",
    "        ": "",
    "       ": "",
    "      ": "",
    "     ": "",
    "    ": "",
    "   ": "",
    "  ": "",
    " ": "",
    "\n": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
}

//需排除的，正则匹配
var cnExcludeWhole = [
    /^x?\d+(\.\d+)?[A-Za-z%]{0,2}(\s.C)?\s*$/, //12.34K,23.4 °C
    /^x?\d+(\.\d+)?(e[+\-]?\d+)?\s*$/, //12.34e+4
    /^\s*$/, //纯空格
    /^\d+(\.\d+)?[A-Za-z]{0,2}.?\(?([+\-]?(\d+(\.\d+)?[A-Za-z]{0,2})?)?$/, //12.34M (+34.34K
    /^(\d+(\.\d+)?[A-Za-z]{0,2}\/s)?.?\(?([+\-]?\d+(\.\d+)?[A-Za-z]{0,2})?\/s\stot$/, //2.74M/s (112.4K/s tot
    /^\d+(\.\d+)?(e[+\-]?\d+)?.?\(?([+\-]?(\d+(\.\d+)?(e[+\-]?\d+)?)?)?$/, //2.177e+6 (+4.01+4
    /^(\d+(\.\d+)?(e[+\-]?\d+)?\/s)?.?\(?([+\-]?(\d+(\.\d+)?(e[+\-]?\d+)?)?)?\/s\stot$/, //2.177e+6/s (+4.01+4/s tot
];
var cnExcludePostfix = [
    /:?\s*x?\d+(\.\d+)?(e[+\-]?\d+)?\s*$/, //12.34e+4
    /:?\s*x?\d+(\.\d+)?[A-Za-z]{0,2}$/, //: 12.34K, x1.5
]

//正则替换，带数字的固定格式句子
//纯数字：(\d+)
//逗号：([\d\.,]+)
//小数点：([\d\.]+)
//原样输出的字段：(.+)
var cnRegReplace = new Map([
    [/^requires ([\d\.]+) more research points$/, '需要$1个研究点'],
    [/^version (.+) released: (.+)$/, '版本 $1 发布日期：$2'],
    [/^(\d+) Royal points$/, '$1 皇家点数'],
    [/^Cost: (\d+) RP$/, '成本：$1 皇家点数'],
    [/^Usages: (\d+)\/$/, '用途：$1\/'],
    [/^workers: (\d+)\/$/, '工人：$1\/'],

]);